package com.jiangwh;

import java.io.IOException;

import org.apache.http.HttpException;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpHead;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.impl.client.DefaultHttpClient;

public class Main {
	public static void main(String[] args) throws HttpException, IOException {
//		System.out
//				.println(new String(Base64.decode("MTIzOjEyMw==".getBytes())));
//		System.out.println(new String(Base64.encode("sa:804e36dbac5e2d61582679d97e0e7abc".getBytes())));
		// 804e36dbac5e2d61582679d97e0e7abc
		HttpClient client = new DefaultHttpClient();
		HttpHead head = new HttpHead("http://192.168.54.32/app-server/service/business/head/login?userName=123&password=1234");
//		HttpDelete delete = new HttpDelete("http://192.168.54.32/app-server/service/business/delete/bindUserInfo/123");
		HttpPut put = new HttpPut("http://192.168.54.32/app-server/service/business/put/deviceAlias/123");
		put.setHeader("Authorization", "Basic MTIzOjEyMw==");
		HttpResponse response= client.execute(head);
		System.out.println(response.getAllHeaders()[0]);
	}
}
